//
//  WSPlayerController.m
//  GKDYVideo
//
//  Created by QuintGao on 2018/9/23.
//  Copyright © 2018 QuintGao. All rights reserved.
//

#import "WSPlayerController.h"



@interface WSPlayerController()
@property (nonatomic, strong) JXCategoryListContainerView *containerView;
@end

@implementation WSPlayerController

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {
        self.hidesBottomBarWhenPushed = NO;
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initUI];
    [self loadRandomTvcharonTV_Request];
}

- (void)initUI {
    [self.view addSubview:self.containerView];
    self.containerView.frame = CGRectMake(0, 0, WSScreenWidth, self.tabBarController.tabBar.mj_y);
}

- (void)loadRandomTvcharonTV_Request {
    [self.playerVC refreshData:^{}];
}



- (GKDYPlayerViewController *)playerVC {
    return (GKDYPlayerViewController *)self.containerView.validListDict[@(0)];
}


#pragma mark - JXCategoryViewDelegate
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {

}

#pragma mark - JXCategoryListContainerViewDelegate
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
    return 1;
}

- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
    GKDYPlayerViewController *playerVC = [[GKDYPlayerViewController alloc] init];
    playerVC.delegate = self;
    return playerVC;
}

- (Class)scrollViewClassInlistContainerView:(JXCategoryListContainerView *)listContainerView {
    return GKDYScrollView.class;
}

#pragma mark - 懒加载

- (JXCategoryListContainerView *)containerView {
    if (!_containerView) {
        _containerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
    }
    return _containerView;
}

@end
